home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / cap / include / awk.h next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.8 KB  |  85 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17.  
  18. /*
  19.  * Visible definitions
  20.  */
  21. #ifndef FALSE
  22. #define FALSE        0
  23. #endif
  24.  
  25. #ifndef TRUE
  26. #define TRUE        1
  27. #endif
  28.  
  29. #define AWK_INDEX    0
  30. #define AWK_INT        1
  31. #define AWK_FLOAT    2
  32. #define AWK_STRING    3
  33. #define AWK_POINTER    4
  34.  
  35. /*
  36.  * Visible structure definitions
  37.  */
  38. typedef struct {
  39.     int max;        /* maximum number of elements in the array */
  40.     int remain;        /* remaining locations in the array */
  41.     int index;        /* index used by nextkey() command */
  42.     char *name;        /* the name of the array */
  43.     char **key;        /* pointer to a list of key strings, 1 per element */
  44.     int *ival;        /* pointer to a list of int value, int arrays only */
  45.     float *fval;    /* pointer to a list of float values, float only */
  46.     char **string;    /* pointer to a list of strings, string arrays only */
  47.     int access;        /* count number of accesses of the array */
  48.     int search;        /* count number 'index bumps' during accesses */
  49. } AwkArray;
  50.  
  51. /*
  52.  * Visible global variable definitions
  53.  */
  54. extern int awkNF;
  55. extern int awkNL;
  56. extern int awkNR;
  57. extern int awkFS;
  58. extern int awkRS;
  59. extern char awkFILENAME[];
  60. extern char *awkARG[];
  61.  
  62. /*
  63.  * Visible procedure and function definitions
  64.  */
  65. void    awkAddFloat (AwkArray *array, char *key, float f);
  66. int    awkAddIndex (register AwkArray *array, register char *key);
  67. void    awkAddInt (AwkArray *array, char *key, int i);
  68. void    awkAddPointer (AwkArray *array, char *key, void *p);
  69. void    awkAddString (AwkArray *array, char *key, char *s);
  70. AwkArray* awkNewArray (char *name, int type);
  71. void    awkExit (void);
  72. void    awkFile (char *name);
  73. void    awkInit (int argc, char **argv);
  74. int    awkStrSame (register char *s1, register char *s2);
  75. void    awkFirstKey (AwkArray *array);
  76. float    awkGetFloat (AwkArray *array, char *key);
  77. int    awkGetIndex (register AwkArray *array, register char *key);
  78. int    awkGetInt (AwkArray *array, char *key);
  79. void*    awkGetPointer (AwkArray *array, char *key);
  80. void    awkGetString (AwkArray *array, char *key, char *s);
  81. int    awkNextKey (AwkArray *array, char *key);
  82. int    awkNextRecord (void);
  83. int    awkStrIndex (register char *s1, register char *s2);
  84. void    awkSubStr(register char *s1, register char *s2, register m, register n);
  85.